<?php

/**
 * x
 * The index file for Team Players is, as you can see, quite slim, so here is a brief description of what's going on:
 * First we declare the namespace that TP operates within, that is, TeamPlayers. Since all the files operate within this 
 * namespace, you can access the singleton instance of the class TeamPlayers from anywhere where "namespace TeamPlayers"
 * is defined. This is handy, because the TeamPlayers singleton holds the smarty instance, sql instance, handy info, 
 * and functions for access control, so that you can quickly assign, check and revoke rights from wherever!
 * 
 * Second we include the TeamPlayers config file. This file declares site wide constants, and also includes a file
 * from the classes folder called TeamPlayers.class.php. This file is the beef in our hamburger, as it includes a 
 * series of other files from the classes folder. The files that are included deal with access control, authentication
 * roles etc, as well as establishing an SQLi connection which is stored in the TeamPlayers class within the TeamPlayers
 * namespace. This is the SQL connection you use to put and retrieve data from SQL.
 * 
 * Third, this file runs the Router class. This class reads the parameters provided in the url, and hands control
 * over to an appropriate controller. If no controller is specified in the URL, the Router will hand control to the
 * default controller, as defined in the config file.
 * 
 * In essence, this file acts as the front controller for the website, and deals with routing and access control (so that
 * you don't have to!)
 * 
 * NOTE: This system uses a front-controller pattern. This means that all requests are handed through this file, as 
 * defined by the .htaccess file. In order for the system to work, you need to make sure this file is properly set up
 * (some FTP clients omit transfering files that start with a .). You also need to check that your apache installation
 * has mod_rewrite enabled. The package should include such an .htaccess file, so make sure it gets uploaded properly.
 * 
 * @author Martin Sommervold - martin@sommervold.com
 * @author Leo Valen (the access control system) - leo@valen.pro
 * @todo implement routing method to allow for custom design pages
 *
 */ 
namespace TeamPlayers;


require_once("TeamPlayers.config.php");

\TeamPlayers\TeamPlayers::getInstance();

require 'Router.php';
$Router = new Router();

